package com.woniu.money.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.money.bean.TFinance;
import com.woniu.money.mapper.TFinanceMapper;
import com.woniu.money.service.ITFinanceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yellowDocter
 * @since 2022-08-09
 */
@Service

public class TFinanceServiceImpl extends ServiceImpl<TFinanceMapper, TFinance> implements ITFinanceService {

    @Resource
    private TFinanceMapper mapper;
    //应收账务,页面展示,分页,查询
    @Override
    public Page<TFinance> All(
            Integer currentPage, Integer pageSize, Integer orderId,
            String username, LocalDateTime startTime, LocalDateTime endTime)
    {
        Page<TFinance> tFinancePage = new Page(currentPage, pageSize);
        return mapper.getAll(tFinancePage, orderId, username, startTime, endTime);
    }


    //回单
    @Override
    public List<TFinance> seltt( Integer orderId, String username) {
        List<TFinance> seltt = mapper.seltt(orderId, username);
        return seltt;
    }

    @Override
    public List<TFinance> sel() {
        List<TFinance> sel = mapper.sel();
        return sel;
    }

    //修改
    @Override
    public int up(Integer financeId, Integer state) {
        int up = mapper.up(financeId, state);
        return up;
    }
}
